package com.tfswx.jkgl.designer.api;

import com.tfswx.jkgl.designer.bean.Sjy;
import com.tfswx.jkgl.designer.dto.DtoGetInputDTO;
import com.tfswx.jkgl.designer.service.DtoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author ricky
 * @date 2021/12/13
 */
@Api(tags = "api控制器")
@RestController
@RequestMapping("api")
public class DtoController {

    @Resource
    private DtoService dtoService;

    @ApiOperation("下载导出dto")
    @GetMapping(value = "/dtoTemplateCreate", produces = "application/octet-stream")
    public void dtoTemplateCreate(DtoGetInputDTO inputDTO) {
        dtoService.createDtoTemplate(inputDTO);
    }

    @ApiOperation("获取数据源")
    @PostMapping(value = "/getSjy")
    public Sjy getSjy() {
        return new Sjy();
    }

}
